﻿<dxc:DXWindow x:Class="ThanNhanTao.frmDmYeuCau"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
         xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
         xmlns:local="clr-namespace:ConvertCustom"
        Title="Danh sách yêu cầu" WindowStartupLocation="CenterScreen"
        dxc:ThemeManager.ThemeName="Office2007Blue" Icon="/ThanNhanTao;component/Images/iconbv48x48.ico"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" WindowState="Maximized">
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="260"></RowDefinition>
                <RowDefinition Height="201*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
           
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="255*" />
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="255*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="102*"></RowDefinition>
                        <RowDefinition Height="92" />
                        <RowDefinition Height="36"></RowDefinition>
                        <RowDefinition Height="4*" />
                    </Grid.RowDefinitions>
                    <GroupBox Header="Thông tin cơ bản" Margin="2,0" Grid.ColumnSpan="4" Grid.Row="0">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Label Content="Mã yêu cầu:" Grid.Column="0" Grid.Row="0" Foreground="Red" />
                            <Label Content="Tên yêu cầu:" Grid.Column="2" Grid.Row="0" Foreground="Red" />
                            <Label Content="Loại yêu cầu:" Grid.Column="0" Grid.Row="1" Foreground="Red" />
                            <Label Content="Đơn vị tính:" Grid.Column="2" Grid.Row="1" Foreground="Red" />
                            <Label Content="Ghi chú:" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="4"/>

                            <dxe:TextEdit Grid.Column="1" Grid.Row="0" 
                               x:Name="txtMaYeuCau" MaxLength="20" TabIndex="1" Margin="2" FontSize="13" FontWeight="Bold" />
                            <dxe:TextEdit Grid.Column="3" Grid.Row="0" 
                              Grid.ColumnSpan="4" x:Name="txtTenYeuCau" MaxLength="100" TabIndex="2" Margin="2" FontSize="13" FontWeight="Bold" />

                            <dxe:ComboBoxEdit AutoComplete="True" Grid.Row="1" Grid.Column="1" MinWidth="49" Name="cboLoaiYeuCau" TabIndex="3"
                              Margin="2" FontSize="13" FontWeight="Bold">                           
                            </dxe:ComboBoxEdit>
                            <dxe:ComboBoxEdit AutoComplete="True" Grid.Row="1" Grid.Column="3" MinWidth="49" Name="cboDonViTinh" TabIndex="4"
                              Margin="2" FontSize="13" FontWeight="Bold">
                            </dxe:ComboBoxEdit>
                            
                            <dxe:TextEdit VerticalContentAlignment="Top" MaxLength="100" x:Name="txtGhiChu" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="3" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" 
                                          TextWrapping="Wrap" TabIndex="5" Margin="2" FontSize="13" FontWeight="Bold" />
                        </Grid>
                    </GroupBox>
                    <GroupBox Header="Trạng thái" Grid.Column="2" Grid.Row="1" Margin="2,0" Grid.ColumnSpan="2">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="100"></ColumnDefinition>
                                <ColumnDefinition Width="100*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <dxe:CheckEdit Content="Nội trú" Grid.Column="0" Grid.Row="0" Name="chkNgoaiTru" TabIndex="10" Margin="2"/>
                        <dxe:CheckEdit Content="Ngoại trú" Grid.Column="0" Grid.Row="1" Name="chkNoiTru" TabIndex="11" Margin="2"/>
                        <dxe:CheckEdit Content="Chạy thận" Grid.Column="1" Grid.Row="0" Name="chkLaChayThan" TabIndex="9" Margin="2" />
                        <dxe:CheckEdit Content="Kích hoạt" Grid.Column="1" Grid.Row="1" Name="chkKichHoat" TabIndex="12" Margin="2"/>
                        </Grid>
                    </GroupBox>
                    <GroupBox Header="Giá" Grid.Row="1" Margin="2,0" Grid.ColumnSpan="2">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                        <Label Content="Giá yêu cầu:" Grid.Column="0" Grid.Row="0" Foreground="Red" />
                        <Label Content="Quỹ BHYT:" Grid.Column="2" Grid.Row="0" Foreground="Red" />
                        <Label Content="Giá khác:" Grid.Column="0" Grid.Row="1" Foreground="Red" />

                            <dxe:TextEdit Grid.Column="1" Grid.Row="0" 
                               x:Name="txtGiaYeuCau" MaxLength="10" Mask="c0" MaskType="Numeric" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)" TabIndex="6" Margin="2" FontSize="13" FontWeight="Bold" />
                            <dxe:TextEdit Grid.Column="3" Grid.Row="0" 
                              x:Name="txtQuyBHYT" MaxLength="10" Mask="c0" MaskType="Numeric" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)" TabIndex="7" Margin="2" FontSize="13" FontWeight="Bold" />
                            <dxe:TextEdit Grid.Column="1" Grid.Row="1"  
                             x:Name="txtGiaKhac" MaxLength="10"  Mask="c0" MaskType="Numeric" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)" TabIndex="8" Margin="2" FontSize="13" FontWeight="Bold" />

                        </Grid>
                    </GroupBox>

                    <Button Content="Đóng" Margin="0,6,5,6" Grid.Row="2" Height="23" HorizontalAlignment="Right" Name="buttonDong" VerticalAlignment="Center" Width="80" TabIndex="15" Click="buttonDong_Click" Grid.Column="3" />
                <Button Content="Lưu" Margin="0,6,90,6" Grid.Row="2" Height="23" HorizontalAlignment="Right" Name="buttonLuu" VerticalAlignment="Center" Width="80" Grid.Column="3" TabIndex="13" Click="buttonLuu_Click" />
                <Button Content="Thêm mới" Margin="0,6,175,6" Grid.Row="2" Height="23" HorizontalAlignment="Right" Name="buttonHuyBo" VerticalAlignment="Center" Width="80" Grid.Column="3" TabIndex="14" Click="buttonHuyBo_Click" />
            </Grid>
           
            <dxg:GridControl Grid.Row="1" Name="GridDanhSach" Margin="0,0,0,6">
                <dxg:GridControl.Columns>
                    <dxg:GridColumn Name="cluMaYeuCau" Header="Mã" FieldName="MaYeuCau"/>
                    <dxg:GridColumn Name="cluLoaiYeuCau" Header="Loại yêu cầu" FieldName="Dm_LoaiYeuCau.TenLoaiYeuCau"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluTenYeuCau" Header="Yêu cầu" FieldName="TenYeuCau"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluDonViTinh" Header="Đơn vị tính" FieldName="Dm_DonViTinh.TenDonViTinh"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluLaChayThan" Header="Chạy thận" FieldName="LaChayThan"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluChoNoiTru" Header="Nội trú" FieldName="ChoNoiTru"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluChoNgoaiTru" Header="Ngoại trú" FieldName="ChoNgoaiTru"></dxg:GridColumn>
                    <dxg:GridColumn Name="cluKichHoat" Header="Kích hoạt" FieldName="KichHoat"></dxg:GridColumn>
                    <dxg:GridColumn Width="30" AllowResizing="False" Header="" AllowEditing="False" FieldName="Xoa" Name="btnXoaRowYeuCau" AllowMoving="False" ReadOnly="True">
                        <dxg:GridColumn.DisplayTemplate>
                            <ControlTemplate>
                                <Button Name="btnDelRowYeuCauT" Content="x" Click="btnDelRowYeuCauT_Click">
                                </Button>
                            </ControlTemplate>
                        </dxg:GridColumn.DisplayTemplate>
                    </dxg:GridColumn>
                </dxg:GridControl.Columns>
                <dxg:GridControl.View>
                    <dxg:TableView ShowAutoFilterRow="True" Name="TBvDmYeuCau" MouseDoubleClick="TBvDmYeuCau_MouseDoubleClick" KeyUp="TBvDmYeuCau_KeyUp"
                                           ShowGroupedColumns="False" ShowColumnHeaders="True" 
                                           ShowGroupPanel="False" AutoWidth="False" AllowEditing="False" 
                                           AllowDrop="False" AllowGrouping="False" AllowMoveColumnToDropArea="False" 
                                           AllowMoving="False" IsColumnMenuEnabled="False" IsDeferredScrolling="False" 
                                           IsGroupPanelMenuEnabled="False" IsRowCellMenuEnabled="False" 
                                           IsTotalSummaryMenuEnabled="False">
                    </dxg:TableView>
                </dxg:GridControl.View>
            </dxg:GridControl>
        </Grid>
    </Grid>
</dxc:DXWindow>
